from xml.dom import minidom
import sys

setting=sys.argv[1]

doc = minidom.parse('/home/ben/Jboss/jboss-eap-6.2/bin/jboss-cli.xml')
nodes = doc.getElementsByTagName('port')
for node in nodes:
    current = node.firstChild.nodeValue
    print current
    print setting
    node.firstChild.replaceWholeText(setting)
    print doc.toxml()
